﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using TiEntityObject.Contract;
using Helper.FullTextIndex;
using TI_EntityLib.TiEntityObjects.Clifar;

namespace MergeTI.TiEntityObjects.Clifar
{
    /// <summary>
    /// Международное наименование препарата
    /// </summary>
    public class Inn : IFullindexObject
  {
      [XmlElement("InnNx")]
      public Int32 InnNx { get; set; }

      [XmlElement("InnR")]
      public string InnR { get; set; }

      public string SearchName {get { return InnR.Trim().Replace ("+"," ").Replace (" "," near ") ;}}
      
      [XmlElement("ValidInn")]
      public string ValidInn { get; set; }

      public override string ToString()
      {
          return Helper.Json<Contract>.NewtonSerializeObject(this); 
      }

      public string ID
      {
          get { return InnNx.ToString(); }
      }

      public string ValueInfo
      {
          get { return InnR; }
      }

      public int LengthRank
      {
          get { return Terms.Count; }
      }

      public List<string> Terms
      {
           get {return  RamEngine.ParseText(ValueInfo); } 
      }
      
      /// <summary>
      /// Список торговых наименований входящих в МНН
      /// </summary>  
      public List<TradeNm> ListTradeNm  {get;set;} 
  }
}
